/***********************************************
*				MochitoTranferFactory.java
*				------------
*
*	Author:  		bin04017
*	Created:		17.01.2007
*	Last modifed:	17.01.2007
*	Description:	MochitoTranferFactory.java is for
*
************************************************/
package mochito.tranferFactory;

import java.util.HashMap;

import mochito.MochitoException;
import mochito.clientSide.MochitoSockedClient;
import mochito.serverSide.MochitoSocketServerCreator;

/**
 * @author bin04017
 *
 */
public class MochitoTransferFactory {

	private static MochitoTransferFactory instance = null;
	
	private HashMap<MochitoHost, Thread> opendServers = new HashMap<MochitoHost, Thread>();
	/**
	 * Constructor
	 *
	 */
	private MochitoTransferFactory(){
		
	}
	/**
	 * 
	 * @return instance of MochitoTransferFactory
	 * @throws MochitoException
	 */
	public static MochitoTransferFactory getInstance() throws MochitoException {
		if (instance == null) {
			instance = new MochitoTransferFactory();
		}
		return instance;
	}
	public MochitoSockedClient getConnection(MochitoHost host) throws MochitoException {
		// TODO mtf getConnection
		
		return new MochitoSockedClient(host);
	}
	public MochitoSocketServerCreator createServer(MochitoHost host) {
		// TODO Auto-generated method stub
		MochitoSocketServerCreator mc = new MochitoSocketServerCreator(host);
		mc.run();
		return mc;
	}
}
